on: [push]

jobs:
  publish-runtime-free:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup .NET Core SDK 
        uses: actions/setup-dotnet@v2
        with:
          dotnet-version: 6.0.201
      - name: Install dependencies
        run: dotnet restore
      - name: Publish
        run: dotnet publish -c Release -o bin/runtimefree
      - name: Upload publish results
        uses: actions/upload-artifact@v3
        with:
          name: dotnet--runtime-not-included-results
          path: bin/runtimefree
  publish-win-x64:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup .NET Core SDK 
        uses: actions/setup-dotnet@v2
        with:
          dotnet-version: 6.0.201
      - name: Install dependencies
        run: dotnet restore
      - name: Publish
        run: dotnet publish --sc -c Release -r win-x64 -p:PublishSingleFile=true -o bin/win
      - name: Upload publish results
        uses: actions/upload-artifact@v3
        with:
          name: dotnet--selfcontained-win-x64-results
          path: bin/win
  publish-linux-x64:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup .NET Core SDK 
        uses: actions/setup-dotnet@v2
        with:
          dotnet-version: 6.0.201
      - name: Install dependencies
        run: dotnet restore
      - name: Publish
        run: dotnet publish --sc -c Release -r linux-x64 -p:PublishSingleFile=true -o bin/linux
      - name: Upload publish results
        uses: actions/upload-artifact@v3
        with:
          name: dotnet--selfcontained-linux-x64-results
          path: bin/linux